package com.pet.system.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/** 字符工具类 */
public class StringUtil {

  /**
   * 转换逗号分隔的long字符串为Integer数字
   *
   * @param strs
   * @return
   */
  public static List<Integer> parseInteger(String strs) {
    List<Integer> ls = new ArrayList<>();
    if (!StringUtils.isEmpty(strs)) {
      for (String str : strs.split(",")) {
        try {
          ls.add(Integer.valueOf(str));
        } catch (NumberFormatException ignored) {
        }
      }
    }
    return ls;
  }
}
